home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Security / FULL - Iolo Drive Scrubber 3.5 / DriveScrubber3.exe / {code_GetDSDir} / dshtml.dll / 1033 / HTML / LABEL.JS < prev    next >
Text File  |  2008-02-07  |  3KB  |  118 lines

  1.  
  2. function Label()
  3. {
  4.   this.ID = "";
  5.   this.Text = "";
  6.   this.Color = "";
  7.   this.Class = "";
  8.   this.Event = "";
  9.   this.OnMouseOver = "";
  10.   this.OnMouseOut = "";
  11.   
  12.   this.Show = __ShowLabel;
  13.   this.Hide = __HideLabel;
  14.   this.Render = __RenderLabel;
  15.   this.SetLabelText = __SetLabelText;
  16.   
  17.   
  18.   this.ChangeText = __ChangeText;
  19.   this.Visible = __LabelVisible;
  20.  
  21.   this._Visible = true;
  22.   this._Rendered = false;
  23. }
  24.  
  25.  
  26. function __RenderLabel()
  27. {
  28.  if (this._Rendered)
  29.     return "";
  30.     
  31.   var content = "";
  32.   var display = "inline";
  33.   
  34.   var classtext =  this.Class == "" ? "" : " class=\"" + this.Class + "\" ";
  35.   var eventtext =  this.Event == "" ? "" : " onclick=\"" + this.Event + "\" ";
  36.   
  37.   var mouseover = this.OnMouseOver == "" ? "" : " onmouseover=\"" + this.OnMouseOver + "\" ";
  38.   var mouseout = this.OnMouseOut == "" ? "" : " onmouseout=\"" + this.OnMouseOut + "\" ";
  39.   
  40.   
  41.   
  42.   if (!this._Visible)
  43.   {
  44.     display = "none";
  45.  
  46.      content += "<span " + classtext + " " + eventtext + " id=\"label_" + this.ID + "\" style=\"display:" + display + "\" " + mouseover + mouseout + ">";
  47.   }else
  48.   {
  49.     content += "<span " + classtext + " " + eventtext + " id=\"label_" + this.ID + "\" " + mouseover + mouseout + " >";
  50.   }
  51.   //content += "<span id=\"label_" + this.ID + "\" style=\"display:" + display + "\">";
  52.   
  53. //  content += "<span id=\"label_" + this.ID + "\" ";
  54. //  if (!this._Visible) content += "style=\"display:" + display + "\" ";
  55. //  contetn += ">";
  56.   
  57.   
  58.  if(this.Color != "")
  59.    content += "<font color="+this.Color+">";
  60.    
  61.   content += this.Text;
  62.   
  63.  if(this.Color != "")
  64.   content += "</font>";
  65.     
  66.   content += "</span>";
  67.   
  68.   this._Rendered = true;
  69.   
  70.   return content;
  71. }
  72.  
  73. function __SetLabelText(label)
  74. {
  75.   var element = document.getElementById("label_" + this.ID);
  76.   
  77.   var content = "";
  78.   
  79.   if(this.Color != "")
  80.     content += "<font color="+this.Color+">";
  81.     
  82.   content += label;
  83.   
  84.   if(this.Color != "")
  85.    content += "</font>";
  86.    
  87.    element.innerHTML = content;
  88.    
  89. }
  90.  
  91. function __HideLabel()
  92. {
  93.   var element = document.getElementById("label_" + this.ID);
  94.   element.style.display = "none";
  95. }
  96.  
  97. function __ShowLabel()
  98. {
  99.   var element = document.getElementById("label_" + this.ID);
  100.   element.style.display = "block";
  101. }
  102.  
  103.  
  104. function __ChangeText()
  105. {
  106.  this.SetLabelText(this.Text);
  107.  
  108. }
  109.  
  110. function __LabelVisible()
  111. {
  112.   var element = document.getElementById("label_" + this.ID);
  113.   var panelDisplay = element.style.display;
  114.   
  115.   return panelDisplay == "none" ? false : true;
  116.    
  117.   
  118. }